home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 8 / FM Towns Free Software Collection 8.iso / t_os / artemis / artsrc2 / gboxline.asm < prev    next >
Assembly Source File  |  1994-06-01  |  2KB  |  132 lines

  1. ;    私製ライブラリ・グラフィック篇
  2. ;    (c) MATSUUCHI Ryosuke in Dec, 1992
  3. ;
  4. ;    gboxline.asm
  5. ;
  6. ;    1992. 8.17(Mon)
  7. ;    1992.12.28(Sun)
  8.  
  9.         public    gboxline,grboxline,_gboxline,_grboxline
  10.         extrn    _ghline:near, _gvline:near
  11.         
  12.         include    grplib.inc
  13.  
  14.  
  15.  
  16.         assume    cs:cseg, ds:dseg
  17.  
  18.  
  19.  
  20. dseg segment dword 'DATA'
  21. dseg ends
  22.  
  23.  
  24.  
  25. cseg segment dword 'CODE'
  26.  
  27. ;---------------------------------------------------------------
  28. ;    _grboxline : 四角形の描画
  29. ;        in  EAX:x
  30. ;            EBX:y
  31. ;            ECX:xlen
  32. ;            EDX:ylen
  33. ;            Esi:col
  34. ;            edi:logop
  35. ;---------------------------------------------------------------
  36.  
  37.  
  38. _grboxline    proc near
  39.         pushad
  40.         add    ecx,eax            ;ecx := x2
  41.         dec    ecx
  42.         xchg    ebx,ecx            ;ebx←x2,ecx←y
  43.         xchg    edx,esi            ;edx←col
  44.         xchg    esi,edi            ;esi←logop edi←ylen
  45.         call    _ghline
  46.         cmp    edi,2
  47.         jl    #0
  48.             push    ecx        ;y を 保存
  49.             add    ecx,edi        ;ecx ← y2
  50.             dec    ecx
  51.             call    _ghline
  52.             pop    ecx        ;ecx ← y1
  53.             cmp    edi,3
  54.             jl    #1
  55.                 add    edi,ecx        ;edi ← y2-1
  56.                 dec    edi
  57.                 dec    edi
  58.                 inc    ecx        ;ecx ← y1+1
  59.                 xchg    ebx,ecx        ;ebx ← /y1/
  60.                 xchg    ecx,edi        ;ecx ← /y2/ edi←/x2/
  61.                 call    _gvline
  62.                 xchg    eax,edi
  63.                 call    _gvline
  64.             #1:
  65.         #0:
  66.         popad
  67.         ret
  68. _grboxline    endp
  69.  
  70.  
  71.  
  72. grboxline    proc near
  73.         pushad
  74.         pushfd
  75.         mov    eax,[esp+36+4]
  76.         mov    ebx,[esp+36+8]
  77.         mov    ecx,[esp+36+12]
  78.         mov    edx,[esp+36+16]
  79.         mov    esi,[esp+36+20]
  80.         mov    edi,[esp+36+24]
  81.         call    _grboxline
  82.         popfd
  83.         popad
  84.         ret
  85. grboxline    endp
  86.  
  87.  
  88.  
  89. _gboxline    proc near
  90.         push    ecx
  91.         push    edx
  92.         cmp    eax,ecx
  93.         jle    #0
  94.             xchg    eax,ecx
  95.         #0:
  96.         sub    ecx,eax
  97.         inc    ecx
  98.         cmp    ebx,edx
  99.         jle    #1
  100.             xchg    ebx,edx
  101.         #1:
  102.         sub    edx,ebx
  103.         inc    edx
  104.         call    _grboxline
  105.         pop    edx
  106.         pop    ecx
  107.         ret
  108. _gboxline    endp
  109.  
  110.  
  111.  
  112. gboxline    proc near
  113.         pushad
  114.         pushfd
  115.         mov    eax,[esp+36+4]
  116.         mov    ebx,[esp+36+8]
  117.         mov    ecx,[esp+36+12]
  118.         mov    edx,[esp+36+16]
  119.         mov    esi,[esp+36+20]
  120.         mov    edi,[esp+36+24]
  121.         call    _gboxline
  122.         popfd
  123.         popad
  124.         ret
  125. gboxline    endp
  126.  
  127.  
  128.  
  129. cseg ends
  130.  
  131. end
  132.